Skip to content

fix(modes): SETMODES 列表最多保留 96 个模式 - #44

Merged
qiin2333 merged 1 commit into
qiin2333:mainfrom
skyhua0224:fix/setmodes-mode-cap
Oct 27, 2026
Merged

qiin2333 merged 1 commit into
qiin2333:mainfrom
skyhua0224:fix/setmodes-mode-cap

Conversation

@skyhua0224

@skyhua0224 skyhua0224 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

说明

SETMODES 的模式列表超过约 100 个时,重建后的显示器回不来。实机测试:98 个模式正常,105 个时显示器不再发布模式,112 个时显示器消失。驱动里找不到能解释这个现象的限制,所以在 SETMODES 暂存列表之前先封顶。

修改

  • SETMODES 解析后的列表超过 96 个模式时,保留第 0 个(首选模式)和列表末尾最新追加的模式,丢弃中间多出的部分,并写一条警告日志。
  • 不超过 96 个时行为不变。

验证

Summary by CodeRabbit

  • 行为调整
    • 模式列表最多保留 96 项。列表超出上限时,将保留首选模式和末尾最新的 95 项,其余中间项目不再纳入后续处理。

A re-created monitor did not come back when SETMODES published more than
about 100 modes (98 worked, 105 and 112 failed on a real host). No limit
in the driver explains this, so cap what SETMODES stages, keeping the
preferred mode and the newest appended entries, and log what is dropped.
Copilot AI balanced review requested due to automatic review settings October 27, 2026 05:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7d40954 and b48791b.

Files selected for processing: 1
  • ZakoVDD/Control/CommandHandlers.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

HandleSetModesCommand 现在将模式列表限制为最多 96 项。超限时保留首项和末尾 95 项,记录警告,并使用截断后的列表进行后续处理。

Changes: 模式列表数量限制

层 / 文件 摘要
超限列表截断
ZakoVDD/Control/CommandHandlers.cpp
列表超过 96 项时,保留索引 0 的模式和末尾 95 项,丢弃中间项,并记录原数量、上限和删除数量。后续比较、暂存和发布均使用截断后的列表。

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related PRs

  • qiin2333/zako-vdd#43:该 PR 从 monitorModes 快照中选择显示器时序;本次变更会影响该快照中的模式列表。

Suggested reviewers: qiin2333

Merge Risk: Minimal · up to b4879

The change is mergeable; the truncation branch is statically validated, with normal runtime validation still advisable.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed 标题明确说明了 SETMODES 列表最多保留 96 个模式,与本次变更的主要目标一致。
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@skyhua0224 skyhua0224 changed the title fix(modes): cap SETMODES lists at 96 modes fix(modes): SETMODES 列表最多保留 96 个模式 Oct 27, 2026
@qiin2333
qiin2333 merged commit 6a7aa52 into qiin2333:main Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants